-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Remove congestion multiplier from calculate fee #34865
Remove congestion multiplier from calculate fee #34865
Conversation
as Draft until rebaseed after #34821 is merged |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #34865 +/- ##
=========================================
- Coverage 81.7% 81.7% -0.1%
=========================================
Files 826 826
Lines 223413 223411 -2
=========================================
- Hits 182614 182573 -41
- Misses 40799 40838 +39 |
4920552
to
49adf4f
Compare
remove congestion_multiplier from calculacte_fee(), leave parameters unused for now.
49adf4f
to
d8fff7f
Compare
// new bank's fee_structure.lamports_per_signature should be inline with | ||
// what's configured in GenesisConfig | ||
self.fee_structure.lamports_per_signature = | ||
derived_fee_rate_governor.lamports_per_signature; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
currently behavior:
- genesis_config either have fee_rate_gonervor set to 0 (or any other value) lamports_per_signature for test or 5_000 in production;
- fee_structure is always default to 5_000 lamports_per_signature regardless.
This change is to initialize fee_structure to have same lamports_per_signature as in fee_rate_governor.
@@ -80,17 +80,10 @@ impl FeeStructure { | |||
pub fn calculate_fee( | |||
&self, | |||
message: &SanitizedMessage, | |||
lamports_per_signature: u64, | |||
_lamports_per_signature: u64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will remove this parameter in separate PR involving removing fetching nonce lamports_per_signature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This reverts commit 73d3973.
* Revert "refactor unused parameter (#34970)" This reverts commit 0838909. (cherry picked from commit 1542392) # Conflicts: # sdk/src/fee.rs * Revert "separate priority fee and transaction fee from fee calculation (#34757)" This reverts commit 5ecc47e. (cherry picked from commit df2ee12) # Conflicts: # sdk/src/fee.rs * Revert "Remove congestion multiplier from calculate fee (#34865)" This reverts commit 73d3973. (cherry picked from commit 0dcac3f) # Conflicts: # sdk/src/fee.rs * fix merge conflicts --------- Co-authored-by: Tao Zhu <[email protected]>
Problem
congestion_multiplier
variable insdk::fee_structure::calculate_fee(...)
does not have to do with congestion, it actually zeros out transaction fee for tests that don't handle transaction fees - those tests sets fee rate to zero in genesis config.It is better to sync up fee_structure with fee_rate_governor during bank initialization to support those tests.
Summary of Changes
congestion_multiplier
in calculation_fee()Fixes #